Skip to content

feat(api): add the shared abort, timeout and error plumbing (#1311 split u0) - #2800

Open
easonLiangWorldedtech wants to merge 1 commit into
Zoo-Code-Org:mainfrom
easonLiangWorldedtech:split/1311-u0-abort-plumbing
Open

easonLiangWorldedtech wants to merge 1 commit into
Zoo-Code-Org:mainfrom
easonLiangWorldedtech:split/1311-u0-abort-plumbing

Conversation

@easonLiangWorldedtech

Copy link
Copy Markdown
Contributor

Part of #2799 (split plan for #1311). Unit u0 of 4.

Scope

The shared plumbing that the provider units consume. No provider file is in this patch.

  • abort-signal.ts: mergeAbortSignalAndTimeout, rejectOnAbort, isTimeoutAbort, createTimeoutError.
  • error-handler.ts: handleOpenAIRequestError keeps an HTTP failure's identity over a racing abort (hasNumericHttpStatus) and reports a deadline as TimeoutError.
  • request-timeout.ts: getRequestTimeoutMs.
  • test-utils/errors.ts: captureError.

Budget (standalone vs dd30249147)

Changed executable lines: 18 (cap 500). a+d: ~250.

Verification

  • utils + test-utils specs: 643 rows pass.
  • tsc --noEmit: clean.
  • eslint --prune-suppressions --max-warnings=0: clean, and src/eslint-suppressions.json moves down (1 addition, 6 deletions).
  • prettier: clean.

Merge order

u0 -> u1 (split/1311-u1-openai-family) -> u2 (split/1311-u2-zai) -> u3 (split/1311-u3-kimi-code). u0 owns createAbortError, mergeAbortSignalAndTimeout, isTimeoutAbort, rejectOnAbort, bridgeExternalAbortSignal, hasNumericHttpStatus and createTimeoutError; every later unit consumes them and adds no copy.

…-Org#1311 split u0)

Unit u0 of the split plan in Zoo-Code-Org#2799. It carries the shared helpers that the
provider units of Zoo-Code-Org#1311 consume, and nothing provider-specific.

- abort-signal.ts: mergeAbortSignalAndTimeout, rejectOnAbort, and the timeout
  classification helpers (isTimeoutAbort, createTimeoutError).
- error-handler.ts: handleOpenAIRequestError keeps an HTTP failure's identity over
  a racing abort and reports a deadline as TimeoutError.
- request-timeout.ts: getRequestTimeoutMs for the per-request SDK timeout.
- test-utils/errors.ts: captureError, used by the cancellation rows of the
  provider units.

Evidence: 643 rows across the utils and test-utils specs pass; tsc --noEmit clean;
eslint --prune-suppressions --max-warnings=0 clean; prettier clean.
@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Review status

Thanks for contributing. This comment tracks the review sequence and the next action.

Current step: Fix the failing required CI checks; awaiting-maintainer requires CI and automated review completion.

Review-state labels are managed by this workflow; do not edit them manually. community-approved is managed the same way — do not add or remove it manually. It signals a fresh community code approval for the current head as an advisory priority only; maintainer review is still required.

@coderabbitai

coderabbitai Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one): 1

  • coderabbit-review-active

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@codecov

codecov Bot commented Dec 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.33333% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/api/providers/utils/error-handler.ts 88.88% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Changed-code mutation testing

Report for PR head c6f18d3e15fe.

Surviving / uncovered mutants Advisories
0 1
Details: mutants, guidance, and reproduction

Changed-code mutation testing

PackageChanged executable linesValidKilledTimeoutSurvivedNo coverageResult
extension1800000Advisory incomplete

Focused tests

  • extension (cwd src): The mutation run was incomplete; selected test file names were not recorded. See Advisory findings for the failure.

Reproduce locally

From a full checkout containing both commits:

pnpm install --frozen-lockfile
node scripts/stryker-diff.mjs ci --base 9f8e4836680277425d36b47866b65b1b78b8b55c --head 841eb86dc8b7118c6de1e5529c85220fa6a5256a

Mutation reports

  • extension: reports/mutation/extension/mutation.html

The workflow uploads generated reports in the changed-code-mutation-report artifact. A direct artifact link appears below after upload.

Advisory findings

  • extension Stryker preflight failed: 18:10:14 (2986) INFO ProjectReader Found 3 of 1453 file(s) to be mutated. 18:10:14 (2986) INFO Instrumenter Instrumented 3 source file(s) with 24 mutant(s) 18:10:15 (2986) INFO ConcurrencyTokenProvider Creating 2 test runner process(es). 18:10:17 (2986) INFO DryRunExecutor Note: running the dry-run only. No mutations will be tested. 18:10:17 (2986) INFO DryRunExecutor Starting initial test run (vitest test runner with "perTest" coverage analysis). This may take a while. 18:14:50 (2986) ERROR DryRunExecutor One or more tests failed in the initial test run: coding eval host command boundary rejects an outside-workspace git diff in clamp-range before command execution Cannot find module '../../../../scripts/agent-evals/coding-fixtures' imported from /home/runner/work/Zoo-Code/Zoo-Code/.stryker-tmp/sandbox-0fgYzW/core/tools/__tests__/coding-eval-boundary.spec.ts 18:14:50 (2986) ERROR Stryker There were failed tests in the initial test run. file:///home/runner/work/Zoo-Code/Zoo-Code/node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@stryker-mutator/core/dist/src/process/3-dry-run-executor.js:65 throw new ConfigError('There were failed tests in the initial test run.'); ^ ConfigError: There were failed tests in the initial test run. at DryRunExecutor.validateResultCompleted (file:///home/runner/work/Zoo-Code/Zoo-Code/node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@stryker-mutator/core/dist/src/process/3-dry-run-executor.js:65:27) at DryRunExecutor.executeDryRun (file:///home/runner/work/Zoo-Code/Zoo-Code/node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@stryker-mutator/core/dist/src/process/3-dry-run-executor.js:100:14) at process.processTicksAndRejections (node:internal/process/task_queues:103:5) at async WorkItem.execute (file:///home/runner/work/Zoo-Code/Zoo-Code/node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@stryker-mutator/core/dist/src/concurrent/pool.js:32:28) at async file:///home/runner/work/Zoo-Code/Zoo-Code/node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@stryker-mutator/core/dist/src/concurrent/pool.js:69:13 { innerError: undefined } Node.js v22.23.4

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant